include gen_tests.am

TESTS = \
	genbasedir-help.test \
	$(GEN_TESTS) \
	# end of TESTS

# This modified genbasedir script can be used in tests by passing
# GENBASEDIR=./genbasedir_sleep
#
# It artificially sleeps to cause an error due to a race in pipes.
# (The error was present in 0.70.0.)
genbasedir_sleep: $(top_srcdir)/src/genbasedir $(top_srcdir)/apt-repo-tools-tests-genbasedir-sleep.patch
	cp -a $< -T $@
	patch $@ <$(top_srcdir)/apt-repo-tools-tests-genbasedir-sleep.patch

# This modified genbasedir script artificially causes a potential error due
# to a race in pipes and reading an invalid file.
# (The potential error was present in the 0.70.0 implementation of genbasedir.)
genbasedir_invalidate: $(top_srcdir)/src/genbasedir $(top_srcdir)/apt-repo-tools-tests-genbasedir-invalidate.patch
	cp -a $< -T $@
	patch $@ <$(top_srcdir)/apt-repo-tools-tests-genbasedir-invalidate.patch

check_SCRIPTS = genbasedir_sleep genbasedir_invalidate

EXTRA_DIST = init.sh $(TESTS)

CLEANFILES = $(check_SCRIPTS) check.log
